//
//  DanquTableViewCell.m
//  艾听歌
//
//  Created by dllo on 16/5/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "DanquTableViewCell.h"

@implementation DanquTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.numLabel = [[UILabel alloc] init];
        self.numLabel.textColor = [UIColor grayColor];
        self.numLabel.textAlignment = NSTextAlignmentCenter;
        self.numLabel.font = [UIFont systemFontOfSize:16];
        [self.contentView addSubview:self.numLabel];
        self.songName = [[UILabel alloc] init];
        self.songName.textColor = [UIColor blackColor];
        [self.contentView addSubview:self.songName];
        self.singerName = [[UILabel alloc] init];
        self.singerName.textColor = [UIColor grayColor];
        self.singerName.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.singerName];
        self.detailImg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"hear_heart"]];
        [self.contentView addSubview:self.detailImg];
        self.favorites = [[UILabel alloc] init];
        self.favorites.textColor = [UIColor grayColor];
        self.favorites.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.favorites];
    }
    return self;
}
- (void)layoutSubviews{
    [super layoutSubviews];
    self.numLabel.frame = CGRectMake(20, 15, 30, 30);
    
    self.songName.frame = CGRectMake(self.numLabel.frame.origin.x + self.numLabel.frame.size.width + 30, 5, 200, 25);
    
    self.singerName.frame = CGRectMake(self.songName.frame.origin.x, self.songName.frame.origin.y + self.songName.frame.size.height, 100, 25);
    [self.singerName sizeToFit];
    
    self.detailImg.frame = CGRectMake(self.singerName.frame.origin.x + self.singerName.frame.size.width + 5, self.singerName.frame.origin.y, 25, 25);
    
    self.favorites.frame = CGRectMake(_detailImg.frame.origin.x + _detailImg.frame.size.width, self.singerName.frame.origin.y, 80, 25);
}





- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
